package string;

public class SubstringDemo {
    public static void main(StringBuilderDemo[] args) {

        String str = "www.tedu.com.cn";
        int start = str.indexOf(".")+1;
        int end = str.indexOf(".",start);
        String name = str.substring(start,end);
        System.out.println(name);

        /*
        String str = "www.tedu.com.cn";
        int start = 4;
        int end = 8;
        String name = str.substring(start,end);//截取下标4到7的字符串
        System.out.println(name);
        int index1 = str.indexOf(".")+1;
        System.out.println(index1);
        int index2 = str.lastIndexOf(".");
        System.out.println(index2);
        String name1 = str.substring(index1,index2);
        System.out.println(name1);

         */
    }
}
